home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Graphics / ContourPlot / Source / ContourView.h < prev    next >
Text File  |  1993-01-21  |  5KB  |  126 lines

  1. /* ContourView.h -- header file for ContourView class
  2.  * Start 92-05-18  -- See ContourView.m for version and history information.
  3.  * Izumi Ohzawa
  4. */
  5.  
  6. #import <objc/objc.h>        /* for BOOL values YES, NO */
  7. #import <appkit/View.h>
  8. #import <appkit/color.h>
  9. #import <dpsclient/dpsfriends.h>
  10. #import "contour.h"
  11.  
  12. @interface ContourView:View
  13. {
  14.     // storage for scaling factors
  15.     float pXmin, pXmax;    // X bounds of view in points
  16.     float pYmin, pYmax; // Y bounds of view in points
  17.     float ppxu;        // pixels(points) per unit of X
  18.     float ppyu;        // pixels(points) per unit of Y
  19.     float smallx, smally;    // for deciding contour closure
  20.     float xdmin, xdmax;    // min, max values of X data
  21.     float ydmin, ydmax; // min, max values of Y data
  22.     float fdmin, fdmax;    // min, max values of Value
  23.  
  24.     int   nclevels;            // # of contour levels
  25.     CntrAttribute *cA;            // Array of Contour attribute structures
  26.     int numContours;            /* number of contours in contourList */
  27.     ContourPath *contourList;        /* contour path list */
  28.     ContourPath **SortedCntrPtr;    /* sorted index: array of pointers to contourList */
  29.  
  30.     // grid and value data storage
  31.     int   ndata;    // total number of data points = jdim*kdim
  32.     int   nx;        // expanded  (nx1+N6) (possibly interpolated grid size)
  33.     int   ny;        //         (ny1+N6)
  34.     int   nx1;        // non-expanded (but possibly interpolated grid size)
  35.     int   ny1;
  36.     int   nxraw;    // non interpolated (raw grid size)
  37.     int   nyraw;
  38.     float *xd;        // x coordinate array for grid points
  39.     float *yd;        // y coordinate array for gird points
  40.     float *fd;        // value at grid point (x[i], y[i]), i=(0 .. ndata-1)
  41.     int   bipolar;    // =1 if data are pos/neg, =0 if monopolar
  42.     float basevalue;    // value to set to margin regions of expanded array for contour closure
  43.     char *comment;    // comment storage
  44.  
  45.     // Flags
  46.     int   ClearFlag;
  47.     BOOL  enabled;
  48.     BOOL  invertY;
  49.     BOOL  debug;
  50.     BOOL  doFill;
  51.     BOOL  frameON;    // Draw bounds frame
  52.     BOOL  axisON;    // Draw axis
  53.     BOOL  gridON;    // Draw grid
  54.     BOOL  ticksON;    // Draw ticks
  55.     float frameLineWidth;
  56.     float axisLineWidth;
  57.     float gridLineWidth;
  58.     float tickLineWidth, tickLength;
  59.     float axisX, axisY;        // where to draw axis
  60.     float gridXstep, gridYstep;    // spacing of grid
  61.     int   minNumPoints;    // minimum mumber of points for a contour
  62.  
  63.     // Attributes of contour lines and fills
  64.     NXColor  positiveColor;    // color of maximum positive (or max monopolar)
  65.     NXColor  negativeColor;    // color of extreme negative
  66.     NXColor  backgroundColor;   // color of background
  67.     NXColor  contourLineColor;  // color of contour lines
  68.     NXColor  frameColor;    // color of frame rectangle (when enabled)
  69.     NXColor  axisColor;
  70.     NXColor  gridColor;
  71.     NXColor  tickColor;
  72.     float    minorContourLineWidth;    // linewidth of contour lines
  73.     float    majorContourLineWidth;    // major contour's line width
  74. }
  75.  
  76. - initFrame:(NXRect *)nf;
  77. - free;
  78. - (BOOL)acceptsFirstMouse;
  79. - (BOOL)acceptsFirstResponder;
  80. - setScaleXY;
  81. - setEnabled:(BOOL)yn;
  82. - setComment:(char *)cstr :(int)len;
  83. - findMinMax:(float *)x :(int)npts :(float *)vmin :(float *)vmax;
  84. - setInvertY:(BOOL)invy;
  85. - setDebugEnable:(BOOL)de;
  86. - setFillEnable:(BOOL)fe;
  87. - setNumberOfContourLevels:(int)nl;
  88. - setMinMaxOfContourLevels:(float)min :(float)max;
  89. - setContourAttributeArray:(CntrAttribute *)caa :(int)nl;
  90. - setDefaultContourAttributes;
  91. - setContourLineColor:(NXColor)clc;
  92. - setFrameColor:(NXColor)fc;
  93. - setBackgroundColor:(NXColor)bc;
  94. - setFillColors:(NXColor)pe :(NXColor)ne;
  95. - setCartesianGridData:(float *)f :(float)xmin :(float)xmax
  96.                   :(float)ymin :(float)ymax
  97.                   ofSize:(int)nnx :(int)nny
  98.                   withInterpolationTo:(int)n1x :(int)n1y;
  99. - setGridAndValueData:(float *)x :(float *)y :(float *)f ofSize:(int)nnx :(int)nny;
  100. - setFrameEnable:(BOOL)fflag lineWidth:(float)fw;
  101. - setAxisEnable:(BOOL)fflag;
  102. - setGridEnable:(BOOL)fflag;
  103. - setTicksEnable:(BOOL)fflag;
  104. - setAxisLineWidth:(float)alw color:(NXColor)ac position:(float)x :(float)y;
  105. - setGridLineWidth:(float)glw color:(NXColor)gc spacing:(float)xs :(float)ys;
  106. - setTickLineWidth:(float)tlw color:(NXColor)tc length:(float)tll;
  107. - setContourLineWidthMinor:(float)clw andMajor:(float)clwm;
  108. - setMinNumberOfPointsPerContour:(int)mnp;
  109. - clear:sender;
  110. - copy:sender;
  111. - copyPScode:sender;
  112. - plotContour:(ContourPath *)cntr :(DPSContext)cContext;
  113. - findInsideHighLow:(ContourPath *)cntr;
  114. - (BOOL)pointInDomain:(float)xx :(float)yy;
  115. - freeContourList;
  116.  
  117. // Call back method messaged from computeContour() function.
  118. - accumContour:(int)icont :(int)np :(float *)xc :(float *)yc;
  119.  
  120.  
  121. @end
  122.  
  123.  
  124.  
  125.  
  126.